package cc.mrbird.febs.suggest.dao;

import cc.mrbird.febs.suggest.domain.BusBean;
import cc.mrbird.febs.suggest.domain.SuggestBean;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SuggestMapper extends BaseMapper<SuggestBean> {
    @Select("select * from t_suggestion where content like concat('%', concat(#{suggest.content}, '%')) and user_id = #{suggest.userId}")
    IPage<SuggestBean> findSuggestDetail(Page page, @Param("suggest") SuggestBean suggestBean);

    @Select("select * from t_suggestion where replay_content like concat('%', concat(#{suggest.replayContent}, '%'))")
    IPage<SuggestBean> findSuggestAll(Page page, @Param("suggest") SuggestBean suggestBean);

    @Select("select * from t_bus_num order by hour")
    List<BusBean> listBusHour();
    @Select("select * from t_bus_topN")
    List<BusBean> listBusTopN();
    @Select("select * from t_s_station_num")
    List<BusBean> listStation();
    @Select("select * from t_s_bus_num")
    List<BusBean> listBusNum();
    @Select("select * from t_station_topN")
    List<BusBean> listStationTopN();
}
